package com.zzw.springcloud.controller;

import com.zzw.springcloud.bean.Member;
import com.zzw.springcloud.service.MemberFeignService;
import com.zzw.springcloud.utils.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/member/consumer/openfeign")
public class MemberFeignController {

    @Resource
    private MemberFeignService memberFeignService;

    @GetMapping("/selectById/{id}")
    @ResponseBody
    public Result selectById(@PathVariable("id") Integer id) {
        return memberFeignService.selectById(id);
    }

    @PostMapping("/insert")
    @ResponseBody
    public Result insert(@RequestBody Member member) {
        return memberFeignService.insert(member);
    }
}
